package com.cn.gmall.mq.controller;

import com.cn.gmall.common.result.Result;
import com.cn.gmall.common.service.RabbitService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/mq")
public class MqController {
    @Autowired
    private RabbitService rabbitService;

    @GetMapping("/sendMessage")
    public Result sendMsgAndConfirm(){
        rabbitService.sendMessage("exchange.confirm", "routing.confirm", "测试消息");
        return  Result.ok();
    }

}
